/*
 * example_sysfont.h
 *
 * Created: 16.05.2012 10:59:16
 *  Author: Labo
 */ 


#ifndef EXAMPLE_SYSFONT_H_
#define EXAMPLE_SYSFONT_H_

#define WRITE		0x00
#define READ		0x01
#define NUNCHUCK	0xA4
#define ATAVRSBPR1	0xEE

typedef struct{
	int16_t AC1; // 0xAA - 0xAB
	int16_t AC2; // 0xAC - 0xAD
	int16_t AC3; // 0xAE - 0xAF
	uint16_t AC4;// 0xB0 - 0xB1
	uint16_t AC5;// 0xB2 - 0xB3
	uint16_t AC6;// 0xB4 - 0xB5
	int16_t B1;  // 0xB6 - 0xB7
	int16_t B2;  // 0xB8 - 0xB9
	int16_t MB;  // 0xBA - 0xBB
	int16_t MC;  // 0xBC - 0xBD
	int16_t MD;  // 0xBE - 0xBF
	int32_t UT;  // Uncompensated Temperature
	int32_t UP;  // Uncompensated Pressure
	int32_t X1;
	int32_t X2;
	int32_t X3;
	int32_t B3;
	uint32_t B4;
	int32_t B5;
	int32_t B6;
	uint32_t B7;
	int32_t	CT; // Compensated Temperature
	int32_t	CP; // Compensated Pressure
}T_SBPR1_CAL_PROM;

T_SBPR1_CAL_PROM SBPR1_CAL_PROM;

uint8_t twi_send_msg(TWI_t * MyTWI, uint8_t address, uint8_t * data, uint16_t msg_length);
uint8_t twi_read_msg(TWI_t * MyTWI, uint8_t address, uint8_t register_address, uint8_t * data, uint16_t msg_length);
void gfx_mono_draw_hex_byte(uint8_t hex_byte, gfx_coord_t x, gfx_coord_t y, const struct font* font);
uint8_t get_pressure_sensor_eeprom(void);
uint8_t get_pressure_sensor_temperature_and_pressure(uint8_t oversampling_setting);

#endif /* EXAMPLE_SYSFONT_H_ */